************************* Use C-Pg Up to return *******************************
********************* Use Pg Up and Pg Dn to scroll ***************************
*************************** Use C-s to search *********************************
Copyright (C) 1993 Leon van Dommelen      There is no warranty on this software
Library letter: N (FORTRAN.ED)

				  Fortran

This file covers the Fortran mode of Freemacs Mint II.


Topics:				Description
-------------------------------------------------------------------------------

About				Copyright, no warranty, history

Intro				Description of Fortran mode

Getting Started			Setting options

Summary				Key summary
- Help				Interactive listing of Fortran keys
- Setup				Setting up Fortran mode
- Line Termination		Completing old lines and starting new ones
- Reformatting			Fortran mode reformatting keys
- Tabbing			Keys that tab
- Trailing Comments		Aligning Fortran 90 trailing comments
- Ruler				Fortran column ruler
- ENDIF matching		Find the corresponding IF()THEN
- Keywords			Built in abbreviations for Fortran keywords
- Subprograms			Go to start or end or select them
- Compilation			Compilation from `within' Freemacs

Line Wrap			Automatic continuation of long statements
- Setup				How to set continuation defaults
- Keys				Keys that may initiate wrapping
  - M-Return			Wrap line at the cursor
  - Space and Return		Wrap line before the right margin
  - Other			Other keys
- Algorithm			How the wrapping point is selected
- Failure			When the algorithm fails

Reformatting			Automatic line reformatting
- Setup				Setting defaults
- Keys				Keys that reformat
  - C-Tab			Reformat and wrap
  - Tab				Reformat or tab
  - Return			Finish line
  - Digits			Reformat statement labels
  - Other			Other keys
- Algorithm			How the reformatting is performed
- Limitations			Limitations of the reformatting algorithm

Abbreviations			Built in abbreviations for fortran keywords
- Setup				Setting defaults
- Keys				Keys that expand abbreviations
- Abbreviation Format		Format of the built in abbreviations
- Example			Example use of abbreviations

Trailing Comments		How to generate and adjust them

Compilation			How to compile from within the editor
- Setup				How to set things up
- Keys				Keys that compile

Non-Fortran			Useful standard Freemacs functions
- Parenthesis Matching		Finding the right match
- History			Keeping a record of changes
- Fill				Reformatting the text in comments

Problems			Some possible problems with Fortran mode


				= About =
-------------------------------------------------------------------------------


Fortran mode is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 1, or (at your option) any later version.

Fortran mode is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
Fortran mode in file LICENSE.HLP; if not, write to:

			The Free Software Foundation, Inc.
			Kendall Square
			Cambridge, MA 02130
			USA

Written by:

			Leon van Dommelen

See subject:		Contact			Contact Leon van Dommelen


History:
--------

Replaces a Fortran mode written by Thorsten Ohl:

			Thorsten Ohl, td12@ddagsi3.bitnet
			Copyright (C) 1989, 1990 by Thorsten Ohl

09/07/92 First attempt. Fingers crossed.
12/20/92 Added parsing of Lahey errors.
	 Added exit instead of shell to compiler.
	 Empty comment lines no longer acquire trailing spaces with C-Tab.
	 Comment lines are no longer broken if they exceed column 72.
	 Improved listing of abbreviations.
12/05/93 Upgraded to Freemacs Mint II.
	 Fixed bug in fortran-close-block.
	 FORTRAN.HLP added.


				= Intro =
-------------------------------------------------------------------------------


Fortran mode is a Freemacs editing mode for Fortran source files.

Some of its distinguishing features are:

	o  Powerful auto-indentation algorithm

	o  Automatic line-continuation feature

	o  Built-in abbreviations including Fortran 90 ones

	o  Locates the THEN matching an ENDIF

	o  Recognizes trailing comments and trailing statement labels

	o  Recognizes most Fortran 90 extensions

	o  Parses the Lahey error format


In addition it is completely customizable.  You can turn things on or off,
or change formats through a menu.  This allows you to turn off almost all
features if you want. Or you can edit the Fortran mode source code and change
even more.

See topic:	Abbreviations, subtopic Example		Example program


			    = Getting Started =
-------------------------------------------------------------------------------


Getting into Fortran mode is simple: edit any file with a .FOR, .F, .or .FCM
extension.  If your Fortran source file has a different file extension, you
can explicitly enter the command M-x Fortran-mode to force Fortran mode.

In Fortran mode, F1 m shows a brief list of key definitions.

Next change the Fortran mode reformatting features to your liking:
See topic:	Reformatting, subtopic Setup	How to change reformatting

At the least, examine the menu of defaults:
See command:	M-x fortran-set-options		Changes defaults
The menu is over a screen long: press Pg Dn to see the rest.


				= Summary =
-------------------------------------------------------------------------------


This topic summarizes the various keys defined by Fortran Mode.


Help:
-----

C-c C-h			Summarize the Fortran key definitions
See command:		fortran-help			Also: F1 m


Setup:
------

			Make the current buffer a Fortran buffer
See command:		M-x Fortran-mode		Also: M-x for-mode
Note: this command is not needed if the file has the usual .FOR, .F, or .FCM
filename extension.

			Set the Fortran mode defaults
See command:		M-x fortran-set-options

			Show the Fortran mode settings
See command:		M-x fortran-show-options


Line Termination:
-----------------

Return			Reformat the finished line and start the next one
See command:		fortran-newline			Also: C-u 4 Return

M-Return		Start a continuation line
See command:		fortran-split-line

C-Return		Create an end to the block started on this line
See command:		fortran-close-block		Also: C-c C-f

C-m			Start a new line without formatting
See command:		newline

For additional info:
See topic:		Reformatting
See topic:		Line Wrap


Reformatting:
-------------

C-Tab			Reformat the current line and go to the next
See command:		fortran-reformat

Tab			Re-indent the current line
See command:		fortran-indent

Return			Reformat the finished line and start the next one
See command:		fortran-newline

Space			Wrap statements as needed if Fill mode is active
See command:		fortran-split-space

Any digit key		Re-align statement numbers to the 6th column
See command:		fortran-hot-digit

			Convert a label in a separate continue statement
See command:		M-x fortran-make-continue

For additional info:
See topic:		Reformatting
See topic:		Line Wrap


Tabbing:
--------

C-u 0 Tab		Tab to the next tab stop
See command:		fortran-indent

C-i			Insert a Tab character
See command:		Insert-Tab


Trailing Comments:
------------------

M-;			Insert a Fortran 90 trailing comment
See command:		fortran-trailing-comment

For additional info:
See topic:		Trailing Comments


Ruler:
------

M-Tab			Draw a fortran ruler above the current line
See command:		fortran-column-ruler


ENDIF matching:
---------------

M-C-b			Move back over the last matching IF()THEN and ENDIF
See command:		fortran-backward-then

			Flash the THEN matching the ENDIF left of the cursor
See command:		M-x fortran-flash-then


Keywords:
---------

;			Expand the abbreviated keyword left of the cursor
See command:		fortran-expand

C-c a			List the abbreviated keywords
See command:		fortran-list-abbrevs		Also: ?;

For additional info:
See topic:		Abbreviations


Subprograms:
------------

M-Home			Go to the start of the current subprogram
See command:		fortran-goto-beginning		Also: M-C-a

M-End			Go to the end of the current subprogram
See command:		fortran-goto-end		Also: M-C-e

M-C-@			Mark the current subprogram
See command:		fortran-mark-subprogram		Also: M-C-h


Compilation:
------------

C-c C-b			Compile the current buffer
See command:		fortran-compile-buffer

C-c C-r			Compile the selected region from cursor to mark
See command:		fortran-compile-region

For additional info:
See topic:		Compilation


			      = Line Wrap =
-------------------------------------------------------------------------------


This topic discusses generation of a continuation line on M-Return or
automatically when a line exceeds the right margin.


Setup:
------

To enable automatic wrapping of lines when the cursor is beyond the right
margin, turn on Fill mode using F12 or M-x auto-fill-mode. To disable it,
turn Fill mode off.  The active modes are shown on the mode line.
See command:	auto-fill-mode		Set the current Fill mode on/off

The right margin is by default at column 73, giving the standard 72 column
Fortran statements.  It can be changed with C-x f.
See key:	C-x f			Set the current margin

The defaults are set with M-x fortran-set-options. These are:

- N-continuation-prefix is the whitespace preceding continuation marks
- N-continuation-char is the character to use as continuation mark
- N-enter-fill determines whether Fill mode, automatic line wrapping, is
  entered by default
- N-fill-column is the default right margin at which lines are wrapped
- N-breaks are the characters to break lines at, in order of decreasing
  preference

See command:	fortran-set-options	How to change the defaults


Keys:
-----

M-Return:

Use  M-Return to explicitly wrap a statement at the cursor.
See command:	fortran-split-line	Key M-Return

Space and Return:

Statements are also wrapped whenever Space or Return is pressed while
the cursor is beyond the right margin and Fill mode is active.
But in this case, Fortran mode selects a point to wrap at.
See subtopic:	Algorithm		How the point to wrap at is selected
See command:	fortran-split-space	Space key
See command:	fortran-newline		Return key

Other:

Some other keys or commands may also wrap statements:
See command:	fortran-reformat	C-Tab     reformats a line
See command:	fortran-close-block	C-Return  provides a closing statement


Algorithm:
----------

This subtopic discusses how Fortran mode goes about selecting a point
to wrap the statement at in Fill mode.

Lines are never automatically wrapped if:
- Fill mode is inactive;
- There is exclamation mark in the line before the cursor:
  it is assumed that the ! starts a trailing comment;
- The line starts with C, c, D, d, or *:
  these indicate comment lines;
- User-defined function N-don't-reformat returns non-empty.
See command:	fortran-set-options	How to change N-don't-reformat

If it appears that the line should be wrapped, it is first reformatted using
the enabled reformatting procedures.
See command:	fortran-reformat	About reformatting
See topic:	Reformatting		More on reformatting
See command:	fortran-set-options	How to disable various formatting

In choosing a point to wrap at, Fortran mode first looks for a space character.
If there is an acceptable space, the line is wrapped at that position.

If there is no acceptable space, it tries to wrap the line behind an equals
sign. If there is none, it looks successively for a +, -, /,  or * to wrap the
line behind.  This list of break points is stored in variable N-breaks and can
be changed:
See command:	fortran-set-options	How to change N-breaks.

If all of the break points in N-breaks fail, Fortran mode tries to wrap the
line at the start of any alphanumeric string.


Failure:
--------

If Fortran mode fails to find an appropriate wrapping point, an error message
is returned.  The most likely reason is that the right margin is set too small.
Use C-u 73 C-x f to restore the default margin.


			     = Reformatting =
-------------------------------------------------------------------------------


This topic discusses automatic reformatting of Fortran statements to provide
an easily readable source listing.


Setup:
------

It is suggested that you edit one of your existing source files and reformat
it by pressing C-Tab repeatedly.  This will demonstrate how the reformatting
is performed and what you might like to change.

Observe how Fortran mode reformats the indentation, DO statements, statement
labels, and continuation marks.

Also consider the delay in response after pressing C-Tab.  Such a delay will
occur during editing whenever you press Return to end a non-empty line.  On an
8Mhz 286 it is .5 seconds and .25 on a 16Mhz one.  It looks worse using C-Tab
than while editing, though.

Now that you have some idea of how Fortran mode performs by default, change the
default settings using M-x fortran-set-options. This will open up a menu.  For
example, if you want to avoid a visible delay on pressing Return, you would set
item G, N-hot-return to 0.  Reformatting can then still be achieved using Tab
or C-u 1 Tab.

Command M-x fortran-set-options allows you to change certain names selected
from a menu.  These include:

To turn formatting by various keys on or off:
- N-hot-tab determines whether the Tab key reformats the current line
- N-hot-return determines whether the Return key reformats the old line
- N-hot-digits determines whether digits at the start of the statement become
  a statement number

To turn various types of formatting on or off:
- N-reformat-number determines whether statement labels are right aligned
- N-reformat-continuation-prefix determines whether continuation marks are
  re-aligned
- N-reformat-continuation-char determines whether continuation characters are
  replaced
- N-reformat-do determines whether there DO statements are reformatted
- N-reformat-indentation determines whether line indentation is changed.
- N-don't-reformat can be used to turn off all reformatting for certain lines
- N-enter-fill turns on automatic wrapping of long statements
- N-enter-indent turns on automatic indentation of new lines

Desired formatting features:
- N-tab is how far apart to set the tab stops
- N-indent is the base indentation to use
- N-do-indent is the additional indentation within DO loops
- N-if-indent is the additional indentation within conditional constructs of
  various types
- N-continuation-indent is the additional indentation for continuation lines
- N-continuation-prefix is the white space preceding continuation marks
- N-continuation-char is the character to use as continuation mark
- N-do-space specifies the space between DO and label in DO statements
- N-do-term specifies the character immediately behind labels in DO statements
- N-fill-column is the default right margin
- N-comment-column is the default position of Fortran 90 trailing comments
- N-r-trailing-label determines whether there are 8 character trailing labels

Variables that help Fortran mode analyze code:
- N-continuation-regexp specifies the type of continuation used in the file
- N-do-space specifies the space between DO and label in DO statements
- N-do-term specifies the character immediately behind labels in DO statements
- N-r-trailing-label determines whether there are 8 character trailing labels
  in columns 73-80

See command:	fortran-set-options	Description of menu

New lines are automatically indented if Indent mode is active.
See command:	auto-indent-mode	Turn Indent mode on/off
See command:	fortran-set-options	Set the default Indent mode

If you use Indent mode, it is suggested that you set N-hot-digits to 2,
so that statement numbers are automatically put at the start of the line.
See command:	fortran-set-options	To change N-hot-digits


Keys:
-----

C-Tab:

On C-Tab the current line is reformatted.
It is also wrapped if it is too long and Fill mode is active.
See command:	fortran-reformat	C-Tab key
See subtopic:	Algorithm		How things are reformatted
See subtopic:	Setup			How to change the defaults


Tab:

When Tab is pressed once, the current line is automatically reformatted.
If you press Tab twice, the second Tab will tab conventionally.
To prevent the reformatting on Tab, you can precede it with a C-u 0 prefix.
Or you can turn off reformatting on Tab completely by setting N-hot-tab to 0.
In that case C-u 4 Tab will still reformat the line.
See command:	fortran-indent		Tab key
See command:	fortran-set-options	How to change N-hot-tab
See subtopic:	Setup			How to change the defaults

Return:

When Return is pressed, before starting a new line, the old line is
first reformatted.
To prevent this reformatting you can precede Return with a C-u 0 prefix..
Or you can turn off reformatting on Return completely by setting N-hot-return
to 0. In that case C-u 4 Return will still reformat the old line.
See command:	fortran-newline		Return key
See command:	fortran-set-options	How to change N-hot-return

To pre-indent the new line, you can set Indent mode:
See command:	auto-indent-mode	How to enter Indent mode
See command:	fortran-set-options	How to set the default Indent mode
See subtopic:	Setup			How to change the defaults

Digits:

When you enter a numeric label at the start of a statement, the digits are
automatically right aligned to column 6.
If you do not like this. you can set N-hot-digits to 0.
See command:	fortran-hot-digit	Align labels
See command:	fortran-set-options	How to change N-hot-digits

If you are using Indent mode, you may want to set N-hot-digits to 2.
This allows the digits of the label to be pulled back through the indentation,
eliminating the need to move the cursor to the start of the line.

Other:

Some other commands also perform a reformatting.
In particular, automatic wrapping in Fill mode performs an implicit reformat.
See command:	fortran-split-space		Space beyond the right margin
See command:	fortran-trailing-comment	Key M-;
See command:	fortran-make-continue		Not bound to a key


Algorithm:
----------

The reformatting algorithm is complex, but basically it searches for a previous
line to take the indentation from.  It takes the first line it finds that
is not blank, a comment, or a continuation line and takes its indentation.

If the found line is a DO statement, it increases the indentation by 3 spaces.
It will recognize a DO statement if there is a space behind the DO, or
a comma behind the statement label, or else, if the nesting level of
parentheses behind the equals sign and before the comma is not more than one:
 do1i=min(m,n),max(m,n) and doi1=min(m,n),max(m,n) are differentiated from
 do1i=min(m,n)+max(m,n) and doi1=min(m,n)*max(m,n) but a more complex
 do1i=min(m,max(n,k)),j is not recognized.
In the latter case, pressing Tab a second time will give the right indentation.

The additional indentation of 3 spaces inside DO loops can be changed by
setting N-do-indent:
See command:	fortran-set-options	How to set N-do-indent

If the found line is an IF()THEN, ELSE, ELSEIF, CASE, WHERE, ... statement,
the indentation is increased by 3 spaces.
This additional indentation within IF blocks and other conditional constructs
can be changed by setting N-if-indent:
See command:	fortran-set-options	How to set N-if-indent

If the found line has a label and is not a CONTINUE statement, the subprogram
is searched for a matching DO statement.  The indentation is token from this
DO statement, if found.

Next a check is performed for DO WHILE and IF THEN constructs that take more
than a single line.

Next the line being indented is checked, and if it is a ELSE, ENDIF, ELSEWHERE,
ENDWHERE, ... statement, the indentation is decreased correspondingly.

If the line is a labelled CONTINUE statement, the subprogram is searched for
a matching DO statement.  The indentation is token from this DO statement, if
found.

The amount of work in finding the indentation might be noticable if your
machine is slow, or if you type very fast.  Under those conditions you
may want to turn off automatic reformatting of the Tab and Return keys.
You would still be able to reformat by using a C-u 4 prefix before these keys.
See command:	fortran-set-options	Turn off reformatting


Limitations:
------------

The indentation algorithm recognizes Fortran 90 trailing comments.
If needed, it will also recognize the old-fashioned 8 character trailing
labels, as long as all lines have them.
See command:	fortran-set-options	How to turn on trailing labels.

If you turn off reformatting of DO statements and continuation marks,
Fortran mode might not recognize these and occasionally compute an
incorrect indentation.  Use manual indentation with C-u 0 Tab in these cases.

Fortran 90 named DO, CASE, and IF constructs are currently not recognized.
Avoid them or re-indent and close these structures manually.  When I find
people using those, it will be time to think about automating the task.

The source format put out by Fortran mode should compile using the Free Form
option described in the Fortran 90 standard, as well as under the standard
option.


			   = Abbreviations =
-------------------------------------------------------------------------------


Fortran mode allows you to type in abbreviations for keywords which are
expanded into the full text when you press semicolon or C-x '.


Setup:
------

Command M-x fortran-set-options allows you to change abbreviation defaults
through a menu.  The variables that can be set are:

- N-hot-semicolon determines whether semicolon expands abbreviations
- N-case determines whether the expanded text is forced to uppercase

To turn on automatic expansion of abbreviations whenever Space or Return
is pressed, use M-x Abbrev-mode.
See command:	Abbrev-mode


Keys:
-----

;			Expand the abbreviation immediately before the cursor
Unlike C-x ' and Space and Return in Abbrev mode, semicolon does not recognize
user-defined abbreviations.
?;			List all Fortran abbreviations
See command:		fortran-expand

C-x '			Expand the previous abbreviation
User-defined abbreviations take precedence over system-defined ones.
See command:		expand-abbrev

Space or Return		Expand the previous abbreviation if in Abbrev mode
User-defined abbreviations take precedence over system-defined ones.
See command:		M-x Abbrev-mode


Abbreviation Format:
--------------------

The common keywords are one letter:
C Continue	D Do	        E End		G Goto		I If
H tHen		L eLse	        P Print*,	R Read*,	S Stop
T reTurn	W Where

Combination keywords are formed the same way:
ED EndDo	EI EndIf        EW EndWhere	LI eLseIf	LW eLseWhere

Type declarations are the first two letters except COMPLEX and DOUBLE PRECISION:
BY BYte		CH CHaracter    CX CompleX	DI DImension
DP Double Precision	        IN INteger	LO LOgical	RE REal

Segment types are the first two letters:
CO COmmon	EN ENtry        FU FUnction	MO MOdule	PR PRogram
SU SUbroutine

IO tends to use 2 character mnemonics:
CL CLose	FO FOrmat       OP OPen		RD ReaD		RW ReWind
WT WriTe


Example:
--------

In the below example Indent mode was on and N-hot-digits correspondingly set
to 2. To force uppercase Fortran keywords, N-case was set to Yes.  To have
enough space at the right, N-comment-column was reduced to 25.

The left part lists the resulting program, the right what was actually typed.

      PROGRAM tmp	        	   pr;tmp<C-Return>
			        	   <Return>
c     evaluate e^x	        	   <Home>c<End>evaluate e^x<Return>
			        	   <Return>
      IMPLICIT NONE	        	   ino;
      REAL x/1./	! value of x	   re;x/1./<Alt-;>value of x<Return>
      REAL e/1./	! initial sum	   re;e/1./<Alt-;>initial sum<Return>
      REAL t/1./	! first term	   re;t/1./<Alt-;>first term<Return>
      INTEGER n		! term counter	   in;n<Alt-;>term counter<Return>
			        	   <Return>
      DO 10 n=1,50	! max terms        d;10 n=1,50<Alt-;>max terms<C-Return>
	 t=t*x/n	! next term	   t=t*x/n<Alt-;>next term<Return>
	 IF(e+t.EQ.e)THEN        	   i;e+t.EQ.e h;
	    GOTO 11	! exit when done   g;11<Alt-;>exit when done<Down>
	 ENDIF		        	   <Return>
	 e=e+t		        	   e=e+t<Down>
   10 CONTINUE		        	   <Return>
      PRINT*,'ERROR: no convergence!'	   p;'ERROR: No convergence!'<Return>
   11 PRINT*,'The found value is:',e	   11p;'The found value is:',e<Return>
			        	   <C-Tab>
      END

Examination of the above example will show that the number of key motions
(including the shift key) was significantly reduced by using abbreviations.
Since the typical Fortran user puts about 2 or 3 comment lines in a 5000 line
program, the actual savings are likely to be much higher still!

There are other benefits of Fortran mode evident:
- no typos in Fortran keywords, and the resulting wasted time;
- no unintended continuation statements due to insufficient indentation;
- no lines that exceed the 72 column Fortran limit;
- no forgotten block closings.


			 = Trailing Comments =
-------------------------------------------------------------------------------


Fortran 90 trailing comments can be generated using M-;.
If there is already a comment in the current line, M-; realigns it.
See command:	fortran-trailing-comment	Key M-;

Comments will be aligned to column F-comment-colum, by default column 41.
Column F-comment-column can be changed using C-x ;.
See key:	C-x ;				Change the comment column

The default N-comment-column can be changed with M-x fortran-set-options.
See command:	fortran-set-options		Set the default comment column


			      = Compilation =
-------------------------------------------------------------------------------


Fortran mode allows you to run your compiler from within the editor.
By staying in the editor, you can correct the errors without reloading the
editor and file.


Setup:
------

Before you can compile from Freemacs, you need to set up things: define some
Fortran mode N-... names and create a batch file that runs your compiler.

First you need to understand how Fortran mode performs a compilation:
1. When C-c C-b or C-c C-r is pressed, Fortran mode writes the selected buffer
   or subroutine to a scratch file $-N-TEMP.FOR in directory N-scratch-dir.
2. Then it shells out to DOS and executes DOS command N-fortran-command.
   It *expects* N-fortran-command to compile file $-N-TEMP.FOR and put the
   resulting errors in a file $-N-TEMP.LOG.
3. Finally it loads file $-N-TEMP.LOG in a second window. You can then
   scroll the error messages using C-x C-n or C-x C-p.  If an appropriate
   parsing function such as Nparse-error-lahey exists for the compiler, the
   error in the source will be located automatically.  Otherwise M-g can be
   used to go to the error line number.

As a result, in order to allow compilation from Freemacs,
1. Create a batch file, e.g. COMPILE.BAT, that compiles a file $-N-TEMP.FOR
   and puts the errors in file $-N-TEMP.LOG.  See LAHEY.BAT for an example.
   A batch file is not always required, see below, but it can do a better job.
2. Edit a fortran file (to ensure that Fortran is loaded) and enter
   M-x fortran-set-options.
    Set the directory N-scratch-dir that you want to use for the $-N-TEMP
   scratch files, e.g. `c:\emacs\'.  The final `\' is required.
    Set the DOS command N-fortran-command that compiles the buffer.
   For the example, `c:\emacs\compile.bat'.  If you do not want to create a
   batch file, a redirected DOS command such as `LP77 $-N-TEMP > $-N-TEMP.LOG'
   might do the trick.  Substitute your own compilation command for LP77.
    Set the parser N-error-handler to `other' if you do not have a Lahey
   compiler.

That is all that is needed.  Two additional points are noted.  In order for
Fortran mode to automatically locate the errors in the source file, an error
handler for your compiler similar to Nparse-error-lahey is needed.  I will
write one for you if you E-mail me a precise description of the format of all
types error messages generated by your compiler.  Attach a sample error file.
See subject:		contact		For where to send this info
Without a dedicated parser, you will need to use `other', which only scrolls
the error messages.

The second point is the memory constraints. Since Emacs stays in memory, DOS
memory for compilation will be small.  A solution is to make N-shell-program
empty using M-x fortran-set-options.  In that case, Fortran mode exits to DOS
instead of creating a shell to compile the file.  This makes all DOS memory
available for the compilation.

Of course, this is slower since Emacs has to be reloaded after the compilation
is done.  But Emacs will do all the work of reloading the right files.
The only thing you have to remember is to run batch file $-EMACS when returned
to DOS in order to continue the compilation process. ($-EMACS.BAT is a small
batch file created by Freemacs before it exits to DOS).

A second possibility, and the one I use, is to set N-shell-program to
a duplicate COMMAND.COM file COMMAND2.COM.  I have a shareware utility,
SHROOM, from CompuServe's IBMSYS Lib 3 forum that swaps Emacs to a RAM disk
whenever it sees a COMMAND2.COM shell.


Keys:
-----

C-c C-b compiles the entire buffer
See command:	fortran-compile-buffer		Key C-c C-b

C-c C-r compiles the region between cursor and mark.
Typically used after selecting a subprogram with M-C-@.
See command:	fortran-compile-region		Key C-c C-r
See command:	fortran-mark-subprogram		Key M-C-@
See key:	C-@				Set a mark

C-x C-n scrolls the error file.
C-x C-p scrolls the error file backwards.
These keys also locate the error in the source code if an appropriate error
handler exists.
See key:	C-x C-n
See key:	C-x C-p
See command:	M-x fortran-set-options		Set the default error handler


			      = Non-Fortran =
-------------------------------------------------------------------------------

Some standard functions are also very useful for editing Fortran source file.


Parenthesis Matching:
---------------------

When a closing parenthesis is typed, the matching opening parenthesis is
flashed for 1 second or untill another key is pressed.

Double-clicking the left mouse button on any parenthesis will highlight to the
matching parenthesis.


History:
--------

Freemacs allows you to keep a record of changes to your files.

If one of the first three lines in the file is:
C History:
additional comment lines with the date of any modifications will be inserted
each time the file is edited. 'History:' is case-sensitive.

During each save, you will recieve a 'Why' prompt. State the reason for the
modification to be included on the newest history line.


Fill:
-----

If the text in comments extends over several comment lines, you can reformat
it to a uniform right margin.  Set the cursor past the comment initiator
(C, D, *, or !) and indentation and press C-x . to set the fill prefix to
initiator and indentation.  Then fill with M-q.

See key:	C-x .		Set fill prefix
See key:	M-q		Fill a paragraph
See key:	C-x f		Set right margin

Remember to restore the default right margin with C-u 73 C-x f and clear the
fill prefix by pressing C-x . with the cursor at the start of a line.


				= Problems =
-------------------------------------------------------------------------------


Fortran mode expects a standard syntax table, like most of Freemacs Mint II.

If erratic line wrapping occurs, check the mode line that the right margin,
behind the /, is set to 73.

For additional possible problems:
See topic:	Line Wrap, subtopic Failure
See topic:	Reformatting, subtopic Limitations
See topic:	Compilation, subtopic Setup

If you find a bug in Fortran mode, please drop me a note.
See subject:	Contact			How to contact me.


************************* Use C-Pg Up to return  ******************************
************************* Use Pg Up to scroll up ******************************
*******************************************************************************
